<?php
require('db.php');

$data=json_decode(file_get_contents('php://input'));
$result = mysql_query("INSERT INTO competentiespervak(competentieID, vakID ) VALUES ('$data->omschrijving', (SELECT id FROM vak WHERE naam='$data->vak'))") or die (mysql_error());

?>